package OBJECT;


import java.util.Scanner;

// 斐波那契数列
public class FeBoNaer {

    public static void main(String[] args) {

        Scanner scanner = new Scanner(System.in);
        System.out.println("请输入斐波那契数列的数：");
        int n =scanner.nextInt();
        FeBoNaerThone feBoNaerThone = new FeBoNaerThone();
//           feBoNaerThone.fibonacci(n);
           System.out.println("斐波那契数列的数"+feBoNaerThone.fibonacci(n));

        Monkey monkey = new Monkey();
        System.out.println("猴子吃桃子"+monkey.EatPeach(3));
    }

}

class  FeBoNaerThone {
    public  int fibonacci(int n){

        if(n==1||n==2){
            return 1;
        }else if(n >= 3){
           return fibonacci(n-1)+fibonacci(n-2);
        }

        return n;
    }
}


//猴子吃桃子
class  Monkey {

    public int EatPeach(int day){
        if(day == 10){
            return 1;
        }else if(day>=1 &&day<=9){
            return (EatPeach(day+1)+1)*2;
        }else {
            System.out.println("请输入正确的天数");
            return  -1;
        }
    }

}